Is it possible to force a tab/window to take focus without an alert()? [migrated]
Posted
by
Chris Brandt
on Pro Webmasters
See other posts from Pro Webmasters
or by Chris Brandt
Published on 2011-11-22T19:12:56Z
Indexed on
2011/11/23
2:10 UTC
Read the original article
Hit count: 173
JavaScript
|jQuery
I've been working to solve some form / session timeout issues on our site. I'd like to get the users attention BEFORE this happens so that they don't lose data that they've entered into long forms.
I'm using jquery's .get to confirm with my server when the users session is set to timeout, and warn them 5 minutes before then.
I've found that if I pop an alert(), it will bring the focus back to that tab / page -- but this seems 'heavy handed'.
Is there a better way to do this?
© Pro Webmasters or respective owner